﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="newpurchase.ascx.cs" Inherits="Admin_UserControl_newpurchase" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<style>
    .purchase
    {
        margin: 10px;
        border: 1px solid #CCCCCC;
        float: left;
    }
    .purchase td
    {
        padding-top: 10px;
        padding-left: 10px;
    }
    .purchase_button
    {
        float: left;
        margin-top: 40px;
        text-align: center;
    }
    .purchase_button td
    {
        padding: 5px 10px;
    }
    .purchase_button .in_put
    {
        background: #F0F0F0;
        height: 26px;
    }
    .td_pur table
    {
        top: 0 !important;
    }
</style>
<div class="Post">
    <div class="Post-tl">
    </div>
    <div class="Post-tr">
    </div>
    <div class="Post-bl">
    </div>
    <div class="Post-br">
    </div>
    <div class="Post-tc">
    </div>
    <div class="Post-bc">
    </div>
    <div class="Post-cl">
    </div>
    <div class="Post-cr">
    </div>
    <div class="Post-cc">
    </div>
    <div class="Post-body">
        <div class="Post-inner">
            <div class="PostContent">
                <h2 class="PostHeaderIcon-wrapper">
                    PURCHASE</h2>
                <table class="purchase">
                    <tr>
                        <td>
                            Date
                        </td>
                        <td>
                            <asp:TextBox ID="txtDate" runat="server" Width="100px"></asp:TextBox>
                            <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDate"
                                Format="dd/MM/yyyy">
                            </asp:CalendarExtender>
                        </td>
                        <td>
                            Order ID:
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox2" runat="server" Width="120px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="color: #f00;">
                            Customer Name
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="txtCustomername" runat="server" Width="200px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
                                ValidationGroup="save" ControlToValidate="txtCustomername"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Company Name
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="txtCompany" runat="server" Width="400px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="color: #f00;">
                            Contact No
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="txtContact" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*"
                                ValidationGroup="save" ControlToValidate="txtContact"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Sale Rep.
                        </td>
                        <td colspan="3">
                            <asp:DropDownList ID="drSaleRep" runat="server" Width="100px">
                            </asp:DropDownList>
                        </td>
                    </tr>
                </table>
                <table class="purchase_button">
                    <tr>
                        <td>
                            <div class="testbt">
                                <asp:HyperLink ID="hypInvice" runat="server" Target="_blank">
                                         Print Invoice
                                </asp:HyperLink>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Button ID="Button2" runat="server" Text="Exit" Style="color: #f00;" CssClass="in_put"
                                OnClick="Button2_Click" />
                        </td>
                    </tr>
                </table>
                <div class="cleared">
                </div>
                <p>
                    Items</p>
                <br />
                <p>
                    <asp:HyperLink ID="linkNewProduct" runat="server" Text="New Product" NavigateUrl="~/Admin/AddNewProduct.aspx"></asp:HyperLink>
                </p>
                <table>
                    <tr>
                        <td>
                            Product Type
                        </td>
                        <td>
                            Manufacture
                        </td>
                        <td>
                            Model
                        </td>
                        <td>
                            Description
                        </td>
                        <td>
                            Quantity
                        </td>
                        <td>
                            Unit Price
                        </td>
                        <td>
                            ExtPrice
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:UpdatePanel runat="server" ID="UpdatePanel4">
                                <ContentTemplate>
                                    <asp:TextBox ID="txtProductType" runat="server" Width="130px" OnTextChanged="txtProductType_TextChanged"
                                        AutoPostBack="true"></asp:TextBox>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                        <td>
                            <asp:UpdatePanel runat="server" ID="UpdatePanel5">
                                <ContentTemplate>
                                    <asp:ComboBox ID="idManufactory" runat="server" AutoCompleteMode="Append" OnSelectedIndexChanged="idManufactory_SelectedIndexChanged"
                                        AutoPostBack="true" Style="vertical-align: top; margin-top: -10px;">
                                    </asp:ComboBox>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                        <td>
                            <asp:UpdatePanel runat="server" ID="UpdatePanel6">
                                <ContentTemplate>
                                    <asp:DropDownList ID="drModel" runat="server" OnSelectedIndexChanged="drModel_SelectedIndexChanged"
                                        AutoPostBack="true" Width="130px">
                                    </asp:DropDownList>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="drModel" EventName="SelectedIndexChanged" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                        <td class="td_pur">
                            <%--<asp:TextBox ID="TextBox9" runat="server" Width="400px"></asp:TextBox>--%>
                            <asp:UpdatePanel ID="UpdatePanel7" runat="server">
                                <ContentTemplate>
                                    <asp:ComboBox ID="cbProductSell" runat="server" Width="300px" AutoCompleteMode="Append"
                                        OnSelectedIndexChanged="cbProductSell_SelectedIndexChanged" AutoPostBack="true">
                                    </asp:ComboBox>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="cbProductSell" EventName="SelectedIndexChanged" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                        <td>
                            <asp:UpdatePanel ID="UpdatePanel8" runat="server">
                                <ContentTemplate>
                                    <asp:TextBox ID="txtQuantity" runat="server" Width="70px" OnTextChanged="txtQuantity_TextChanged"
                                        AutoPostBack="True"></asp:TextBox>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="txtQuantity" EventName="TextChanged" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                        <td>
                            <asp:UpdatePanel runat="server" ID="UpdatePanel9">
                                <ContentTemplate>
                                    <asp:TextBox ID="txt_UnitPrice" runat="server" Width="70px"></asp:TextBox>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                        <td>
                            <asp:UpdatePanel runat="server" ID="UpdatePanel10">
                                <ContentTemplate>
                                    <asp:TextBox ID="txt_ExtPrice" runat="server" Width="70px"></asp:TextBox>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                        <td>
                            <asp:ImageButton ID="insert" runat="server" ImageUrl="~/images/save.png" OnClick="insert_Click" />
                        </td>
                    </tr>
                </table>
                <div class="clear">
                </div>
                <table width="100%">
                    <tr>
                        <td colspan="7">
                            <asp:GridView ID="grdShoppingCart" runat="server" AutoGenerateColumns="False" CellPadding="10"
                                Width="100%" CssClass="grd" OnRowDataBound="grdShoppingCart_RowDataBound">
                                <Columns>
                                    <asp:TemplateField HeaderText="ID" HeaderStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:HiddenField ID="hidField1" runat="server" />
                                            <%# Eval("ProductID") %>
                                        </ItemTemplate>
                                        <ItemStyle Width="40px" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Product Name" HeaderStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <%# Eval("ProductName")%><br />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" Wrap="True" Font-Bold="true" Width="315px"></ItemStyle>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Price" HeaderStyle-Width="100px" HeaderStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:Label ID="lblPrice" runat="server" Text='<%# Eval("UnitPrice")%>'></asp:Label>
                                            <asp:Label ID="lblMatchedPrice" runat="server" CssClass="clsPriceCartMatched" Text="0"></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle Width="60" VerticalAlign="Middle" HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Quantity" HeaderStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:Label ID="txtQuantity" runat="server" Text='<%# Eval("Quantity") %>'></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" Width="70px" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Total Price" HeaderStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <%--<%# Eval("ToatalAmount")%>--%>
                                            <asp:Label ID="lblSubTotal" runat="server" CssClass="clsSubTotalPriceCart"></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle Width="90" VerticalAlign="Middle" HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Delete" HeaderStyle-Width="50px" HeaderStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imgDelete" runat="server" ImageUrl="~/images/del.gif" OnClick="imgDelete_Click"
                                                Style="display: block;" ToolTip="Delete"  />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                </Columns>
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                <HeaderStyle CssClass="grdHeader" />
                                <EditRowStyle BackColor="#2461BF" />
                                <AlternatingRowStyle CssClass="grdAlternateRow" />
                                <RowStyle CssClass="grdRow" />
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
                <table id="tbl">
                    <tr>
                        <td colspan="5" style="width: 500px;">
                        </td>
                        <td style="padding-top: 15px;">
                            GST:
                        </td>
                        <td style="padding-top: 15px;">
                            <asp:UpdatePanel runat="server" ID="upGST">
                                <ContentTemplate>
                                    <asp:TextBox ID="txtGst" runat="server" Width="70px" OnTextChanged="txtGst_TextChanged"
                                        AutoPostBack="True"></asp:TextBox>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="txtGst" EventName="TextChanged" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="5">
                        </td>
                        <td>
                            Total Amount:
                        </td>
                        <td>
                            <asp:UpdatePanel runat="server" ID="upTotalAmount">
                                <ContentTemplate>
                                    <b><b style="color: red"></b>
                                        <asp:Label ID="lbtotalAmount" runat="server" Text="0.00" ForeColor="Red"></asp:Label></b>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6">
                        </td>
                        <td>
                            <asp:Button ID="Button1" runat="server" Text="Save" CssClass="in_put" OnClick="Button1_Click"
                                ValidationGroup="save" />
                        </td>
                    </tr>
                </table>
                <div class="PostFooterIcons metadata-icons">
                </div>
            </div>
            <div class="cleared">
            </div>
        </div>
    </div>
</div>
